package com.probox.common.entity.mapper.customer;

import com.probox.common.entity.domain.customer.CustomerFund;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.probox.common.entity.vo.customer.CustomerFundVo;
import com.probox.order.api.domain.OrderQuery;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 客户收益Mapper接口
 *
 * @author zsy
 * @date 2021-06-18
 */
public interface CustomerFundMapper extends BaseMapper<CustomerFund> {

    /**
     * 扣减客户资金
     * @param fund
     * @return
     */
    public int deductionCustomerFund(CustomerFund fund);

    public Long countJiFen(OrderQuery query);

    /**
     * 增加客户资金
     * @param fund
     * @return
     */
    public int addCustomerFund(CustomerFund fund);

    /**
     * 解冻客户资金
     * @param fund
     * @return
     */
    public int unfreezeCustomerFund(CustomerFund fund);

    /**
     * 无效客户资金减冻结资金
     * @param fund
     * @return
     */
    public int setInvalidCustomerFund(CustomerFund fund);

    /**
     * 冻结客户资金
     * @param fund
     * @return
     */
    public int freezeCustomerFund(CustomerFund fund);

    /**
     * 解冻客户资金
     * @param fund
     * @return
     */
    public int unFreezeCustomerFund(CustomerFund fund);

    List<CustomerFundVo> selectCustomerFund(CustomerFundVo customerFundvo);

    List<CustomerFundVo> selectCustomerPayLevelFund(CustomerFundVo customerFundvo);

    List<CustomerFundVo> selectCustomerFreeLevelFund(CustomerFundVo customerFundvo);

    List<CustomerFund> selectFundListQuery(@Param("minScore") Integer minScore, @Param("performance") BigDecimal performance, @Param("fansNumber") Integer fansNumber, @Param("platformId") Long platformId);
}
